#include <bits/stdc++.h>

using namespace std;
string str[130];
int main()
{
    int n;
    while (cin >> n)
    {
        for (int i = 0; i < n; ++i)
        {
            getline(cin, str[i]);
            if (str[i].find(','))
            {
                str[i] = '\"' + str[i];
                str[i] += '\"';
            }
        }

        for (int i = 0; i < n - 1; ++i)
        {
            cout << str[i] << ", ";
        }
        cout << str[n - 1] << endl;
    }
    return 0;
}
